#pragma once

#include <iostream>
#include <string>
#include "json/json.h"
#include "ParamProcessing.h"


bool CreateFolder(const std::string &folderpath);
bool fileExists(const std::string &filePath);
bool SystemInitialization();

void ConfigureRead();


void ParameterReadUpdate();
// 更新写入参数初始化文件
template <typename T>
void ParameterWrite(std::string key, T value)
{
  Json::Value root;
  Json::Reader reader;
  Json::FastWriter writer;

  std::ifstream file(ParamFilePath);
  if (file.is_open())
  {
    file >> root;
    file.close();
  }

  root[key] = value;

  std::ofstream outFile(ParamFilePath, std::ios::out);
  outFile << root;
  outFile.close();
}